home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Perl Multimedia Cyber Classroom
/
PERL Multimedia Cyber Classroom (Prentice Hall)(1998).ISO
/
perlbyex
/
code.jar
/
08ex007.jar
/
code
/
ch08
/
08ex007
/
08ex007.pl
next >
Wrap
Perl Script
|
1998-04-01
|
448b
|
14 lines
#!/usr/bin/perl
$colors="rainbow";
@colors=("red", "green", "yellow" );
&printit(*colors); #Which color is this?
sub printit{
local(*whichone)=@_; # must use local, not my with globs
print *whichone, "\n"; # the package in main
$whichone="Prism of Light"; # alias for the scalar
$whichone[0]="PURPLE"; # alias for the array
}
print "Out of subroutine.\n";
print "\$colors is $colors.\n";
print "\@colors is @colors.\n";